package com.jspgou.cms.entity.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the jc_shop_level table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="jc_shop_level"
 */

public abstract class BaseShopLevel  implements Serializable {

	public static String REF = "shopLevel";
	public static String PROP_DEFAULTLEVEL = "defaultlevel";
	public static String PROP_AMOUNT = "amount";
	public static String PROP_LVORDER = "lvorder";
	public static String PROP_ID = "id";
	public static String PROP_LEVELNAME = "levelname";


	// constructors
	public BaseShopLevel () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseShopLevel (java.lang.Long id) {
		this.setId(id);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BaseShopLevel (
		java.lang.Long id,
		java.lang.String levelname,
		java.lang.Long amount,
		java.lang.Byte defaultlevel,
		java.lang.Integer lvorder) {

		this.setId(id);
		this.setLevelname(levelname);
		this.setAmount(amount);
		this.setDefaultlevel(defaultlevel);
		this.setLvorder(lvorder);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Long id;

	// fields
	private java.lang.String levelname;
	private java.lang.Long amount;
	private java.lang.Byte defaultlevel;
	private java.lang.Integer lvorder;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="identity"
     *  column="Id"
     */
	public java.lang.Long getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Long id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: levelname
	 */
	public java.lang.String getLevelname () {
		return levelname;
	}

	/**
	 * Set the value related to the column: levelname
	 * @param levelname the levelname value
	 */
	public void setLevelname (java.lang.String levelname) {
		this.levelname = levelname;
	}


	/**
	 * Return the value associated with the column: amount
	 */
	public java.lang.Long getAmount () {
		return amount;
	}

	/**
	 * Set the value related to the column: amount
	 * @param amount the amount value
	 */
	public void setAmount (java.lang.Long amount) {
		this.amount = amount;
	}


	/**
	 * Return the value associated with the column: defaultlevel
	 */
	public java.lang.Byte getDefaultlevel () {
		return defaultlevel;
	}

	/**
	 * Set the value related to the column: defaultlevel
	 * @param defaultlevel the defaultlevel value
	 */
	public void setDefaultlevel (java.lang.Byte defaultlevel) {
		this.defaultlevel = defaultlevel;
	}


	/**
	 * Return the value associated with the column: lvorder
	 */
	public java.lang.Integer getLvorder () {
		return lvorder;
	}

	/**
	 * Set the value related to the column: lvorder
	 * @param lvorder the lvorder value
	 */
	public void setLvorder (java.lang.Integer lvorder) {
		this.lvorder = lvorder;
	}



	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof com.jspgou.cms.entity.ShopLevel)) return false;
		else {
			com.jspgou.cms.entity.ShopLevel shopLevel = (com.jspgou.cms.entity.ShopLevel) obj;
			if (null == this.getId() || null == shopLevel.getId()) return false;
			else return (this.getId().equals(shopLevel.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}